<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <style>
    .header{
        width: 100%;
        height: 40px;
    }
    .header ul{
        list-style:none;
        padding:0;
        margin: 0;
        overflow: hidden;
    }
    .header ul li{
        width: 120px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        color: #fff;
        background-color: blue;
        float: left;
        margin-right: 10px;
    }
    </style>
</head>
<body>
    <div id="app">
        <!-- 头部 -->
        <Tou></Tou>
        <!-- 脚部-->
    </div>
    <script>
        // Vue.component("组件名称",组件的相关参数[html,css,js代码]);
        Vue.component("Tou",{
            template:`<div class="header">
                        <ul>
                            <li @click="indexHander">{{index}}</li>
                            <li>{{list}}</li>
                        </ul>
                    </div>`,

            data:function(){
                return {
                    index: "首页",
                    list:"列表页"
                }
            },

            methods:{
                indexHander(){
                    alert("跳转到首页");
                }
            }
        });

        let vm = new Vue({
            el:"#app",
            data:{}
        })
    </script>
</body>
</html>